/**
 * outsider.com.cn Inc.
 * Copyright (c) 2011-2022 All Rights Reserved.
 */
package com.yuanmeng.common.core.enums;

import com.yuanmeng.common.core.exception.ServiceException;
import lombok.Getter;

/**
 * @author outsider
 * @version Id: BooleanFlagEnum.java, v 0.1 2022/7/6 15:35 outsider Exp $$
 */
@Getter
public enum SystemTypeEnum {
    MALL("MALL", "商城"),

    COMMUNITY("COMMUNITY", "社区");

    private String code;

    private String message;

    SystemTypeEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public static void validateSystemType(String systemType) {
        int num = 0;
        for(SystemTypeEnum ENUM : SystemTypeEnum.values()) {
            if(ENUM.code.equals(systemType)) {
                num ++;
            }
        }
        if(num == 0) {
            throw new ServiceException("请求参数非法");
        }
    }
}